package org.my.back.controller;

import org.my.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class MyController {
    
    @Autowired
    private MyService myService;
    
    @GetMapping("/hello")
    public String hello(@RequestParam(required = false) String name) {
        // myService.hello(name);
        System.out.println("hello");

        try {
            Thread.sleep(1000);
        }catch (Exception e){
            e.printStackTrace();
        }
        return "Hello " + (name != null ? name : "World");
    }
}